﻿<%@ Page Language="C#" MasterPageFile="~/ProductList/productSite.master" AutoEventWireup="true" CodeFile="ViewProducts.aspx.cs"
    Theme="DXConnect" Inherits="ViewProductsForm" %>
<%@ Register assembly="DevExpress.Web.ASPxEditors.v12.1, Version=12.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dx1" %>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <div class="mainContent registration">
        <div class="contentHeader">
            <div class="content">
                <img id="registrationTitle" src="../Images/title_products.png" alt="Schedule" />
            </div>
        </div>
        <div class="content">

            <table style="width:100%;">
                <tr>
                    <td style="width: 279px">
                        &nbsp;</td>
                    <td>
                        &nbsp;&nbsp;<dx1:ASPxLabel ID="ASPxLabel4" runat="server" CssClass="title" 
                                 Text="View Product List" Font-Size="XX-Large">
                             </dx1:ASPxLabel>
                         &nbsp;</td>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td style="width: 279px">
                        &nbsp;</td>
                    <td>
                        <asp:ListView ID="ListView1" runat="server" DataKeyNames="ProductID" 
                            DataSourceID="productViewSqlDataSource">
                            <AlternatingItemTemplate>
                                <tr style="background-color: #FAFAD2;color: #284775;">
                                    <td>
                                        <asp:Label ID="ProductIDLabel" runat="server" Text='<%# Eval("ProductID") %>' />
                                    </td>
                                    <td>
                                        <asp:Label ID="ModelLabel" runat="server" Text='<%# Eval("Model") %>' />
                                    </td>
                                    <td>
                                        <asp:Label ID="TypeLabel" runat="server" Text='<%# Eval("Type") %>' />
                                    </td>
                                    <td>
                                        <asp:Label ID="PriceLabel" runat="server" Text='<%# Eval("Price") %>' />
                                    </td>
                                </tr>
                            </AlternatingItemTemplate>
                            <EditItemTemplate>
                                <tr style="background-color: #FFCC66;color: #000080;">
                                    <td>
                                        <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                                            Text="Update" />
                                        <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                                            Text="Cancel" />
                                    </td>
                                    <td>
                                        <asp:Label ID="ProductIDLabel1" runat="server" 
                                            Text='<%# Eval("ProductID") %>' />
                                    </td>
                                    <td>
                                        <asp:TextBox ID="ModelTextBox" runat="server" Text='<%# Bind("Model") %>' />
                                    </td>
                                    <td>
                                        <asp:TextBox ID="TypeTextBox" runat="server" Text='<%# Bind("Type") %>' />
                                    </td>
                                    <td>
                                        <asp:TextBox ID="PriceTextBox" runat="server" Text='<%# Bind("Price") %>' />
                                    </td>
                                </tr>
                            </EditItemTemplate>
                            <EmptyDataTemplate>
                                <table runat="server" 
                                    style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;">
                                    <tr>
                                        <td>
                                            No data was returned.</td>
                                    </tr>
                                </table>
                            </EmptyDataTemplate>
                            <InsertItemTemplate>
                                <tr style="">
                                    <td>
                                        <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                                            Text="Insert" />
                                        <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                                            Text="Clear" />
                                    </td>
                                    <td>
                                        &nbsp;</td>
                                    <td>
                                        <asp:TextBox ID="ModelTextBox" runat="server" Text='<%# Bind("Model") %>' />
                                    </td>
                                    <td>
                                        <asp:TextBox ID="TypeTextBox" runat="server" Text='<%# Bind("Type") %>' />
                                    </td>
                                    <td>
                                        <asp:TextBox ID="PriceTextBox" runat="server" Text='<%# Bind("Price") %>' />
                                    </td>
                                </tr>
                            </InsertItemTemplate>
                            <ItemTemplate>
                                <tr style="background-color: #FFFBD6;color: #333333;">
                                    <td>
                                        <asp:Label ID="ProductIDLabel" runat="server" Text='<%# Eval("ProductID") %>' />
                                    </td>
                                    <td>
                                        <asp:Label ID="ModelLabel" runat="server" Text='<%# Eval("Model") %>' />
                                    </td>
                                    <td>
                                        <asp:Label ID="TypeLabel" runat="server" Text='<%# Eval("Type") %>' />
                                    </td>
                                    <td>
                                        <asp:Label ID="PriceLabel" runat="server" Text='<%# Eval("Price") %>' />
                                    </td>
                                </tr>
                            </ItemTemplate>
                            <LayoutTemplate>
                                <table runat="server">
                                    <tr runat="server">
                                        <td runat="server">
                                            <table ID="itemPlaceholderContainer" runat="server" border="1" 
                                                style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;font-family: Verdana, Arial, Helvetica, sans-serif;">
                                                <tr runat="server" style="background-color: #FFFBD6;color: #333333;">
                                                    <th runat="server">
                                                        ProductID</th>
                                                    <th runat="server">
                                                        Model</th>
                                                    <th runat="server">
                                                        Type</th>
                                                    <th runat="server">
                                                        Price</th>
                                                </tr>
                                                <tr ID="itemPlaceholder" runat="server">
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr runat="server">
                                        <td runat="server" 
                                            style="text-align: center;background-color: #FFCC66;font-family: Verdana, Arial, Helvetica, sans-serif;color: #333333;">
                                        </td>
                                    </tr>
                                </table>
                            </LayoutTemplate>
                            <SelectedItemTemplate>
                                <tr style="background-color: #FFCC66;font-weight: bold;color: #000080;">
                                    <td>
                                        <asp:Label ID="ProductIDLabel" runat="server" Text='<%# Eval("ProductID") %>' />
                                    </td>
                                    <td>
                                        <asp:Label ID="ModelLabel" runat="server" Text='<%# Eval("Model") %>' />
                                    </td>
                                    <td>
                                        <asp:Label ID="TypeLabel" runat="server" Text='<%# Eval("Type") %>' />
                                    </td>
                                    <td>
                                        <asp:Label ID="PriceLabel" runat="server" Text='<%# Eval("Price") %>' />
                                    </td>
                                </tr>
                            </SelectedItemTemplate>
                        </asp:ListView>
                    </td>

                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td style="width: 279px">
                        &nbsp;</td>
                    <td>
                        <asp:SqlDataSource ID="productViewSqlDataSource" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:CocShopDatabaseConnectionString %>" 
                            SelectCommand="SELECT * FROM [Product]"></asp:SqlDataSource>
                    </td>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td style="width: 279px">
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                </tr>
            </table>

        </div>
    </div>
</asp:Content>
